home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pp / pp-6.0 / Chans / fax / faxgeneric.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-18  |  4.1 KB  |  122 lines

  1. /* faxgeneric.h: generic fax structure */
  2.  
  3. /*
  4.  * @(#) $Header: /xtel/pp/pp-beta/Chans/fax/RCS/faxgeneric.h,v 6.0 1991/12/18 20:07:09 jpo Rel $
  5.  *
  6.  * $Log: faxgeneric.h,v $
  7.  * Revision 6.0  1991/12/18  20:07:09  jpo
  8.  * Release 6.0
  9.  *
  10.  *
  11.  */
  12.  
  13. #ifndef    _H_FAXGEN
  14. #define _H_FAXGEN
  15.  
  16. /*
  17.  *    The idea is that these routines only need to know about the specific
  18.  *    fax modem. They do not need to know how to generate delivery reports,
  19.  *     whether it is the first or second DR, etc. 
  20.  *
  21.  *    The softc ptr allows each fax modem to have a specific data structure
  22.  *
  23.  *    open (FaxCtlr *)
  24.  *        called once to open the fax device. 
  25.  *        should return OK or NOTOK.
  26.  *    close (FaxCtlr *)
  27.  *        called when channel is shutting down. 
  28.  *        return not checked.
  29.  *    initXmit (FaxCtlr *)
  30.  *        called once for each recipient, before any data is sent. 
  31.  *        called after phone number is determined and set in FaxCtlr *, 
  32.  *        normally will send dial string down to modem. 
  33.  *        returns PP return code
  34.  *    abort (FaxCtlr *)
  35.  *        called at any time to abort transmission. 
  36.  *        return not checked.
  37.  *    termXmit (FaxCtlr *)
  38.  *        called after all pages have been sent to recipient. 
  39.  *        returns OK or NOTOK
  40.  *    setG3Params (FaxCtlr *, struct type_IOB_G3FacsimileParameters *params)
  41.  *        called once per page to set/test G3 parameters including 
  42.  *        resolution of page. also initialises modem for g3fax 
  43.  *        transmission
  44.  *        returns OK or NOTOK
  45.  *    sendPage (FaxCtlr *, char *bits, int len, int last)
  46.  *        called to send one page of G3 fax.
  47.  *        forth parameter indicates whether last bit of fax message.
  48.  *        note that G3 fax page encoded in X.400 order
  49.  *        returns OK or NOTOK
  50.  *    setIA5Params (FaxCtlr *)
  51.  *        call obnce per file of ia5 to initialise modem for ia5 
  52.  *        transmission
  53.  *        return OK or NOTOK;
  54.  *    sendIA5File (FaxCtlr *, char *file, int last)
  55.  *        send one file of IA5 text. 
  56.  *        third parameter indicates whether last bit of fax message.
  57.  *        returns OK or NOTOK
  58.  *    arg_parse (FaxCtlr *, char *key, char *value)
  59.  *        parse an info line argument
  60.  *        return OK or NOTOK
  61.  *
  62.  *    Whenever any routine returns an error status, it should place a
  63.  *    error message into the field 'errBuf'. 
  64.  *
  65.  *    If initXmit(), sendPage(), sendIA5File(), or termXmit() return an 
  66.  *     error status, they
  67.  *    must also set the field 'qmgrErrCode'. This code is used to pass 
  68.  *    error status information back to the qmgr. The only values that
  69.  *    should be returned in this field are
  70.  *        int_Qmgr_status_negativeDR - permanent failure; 
  71.  *            send DR
  72.  *        int_Qmgr_status_messageFailure - transient failure, 
  73.  *            retry message
  74.  *        int_Qmgr_status_mtaFailure - transient failure, 
  75.  *            retry channel 
  76.  *    In the case of the permanent failure, the generic fax driver code
  77.  *    will worry about converting a negativeDR status into a shared DR
  78.  *    status (if necessary). Also, the generic fax code will automatically
  79.  *    build an error report (with 'errBuf' as the message).
  80.  */
  81.  
  82. /*
  83.  *    Generic control data structure for each fax modem
  84.  */
  85. typedef struct _faxCtlr {
  86.     char    *softc;        /* controller specific state */
  87.     int    (*open)();    /* open routine */
  88.     int    (*close)();    /* close routine */
  89.     int    (*arg_parse)();    /* parse info line argument */
  90.     char    errBuf[BUFSIZ];    /* error messages go here */
  91.     int    qmgrErrCode;    /* passed back to Qmgr */    
  92.  
  93. /* outbound parameters and function pointers */
  94.     char    telno[255];    /* telephone number */
  95.     int    (*initXmit)();    /* initialize for transmission */
  96.     int    (*abort)();    /* abort transmission */
  97.     int    (*termXmit)();    /* terminate transmission */
  98.     int    (*setG3Params)();    /* set G3 fax parameters */
  99.     int    (*sendPage)();    /* send one page of G3 fax */
  100.     int    (*setIA5Params)();    /* set of ia5 transmission */
  101.     int    (*sendIA5File)(); /* send one file of IA5 text */
  102.  
  103. /* inbound parameters and function pointers */
  104.     char    channel[BUFSIZ];    /* inbound channel name */
  105.     char    fax_recip[BUFSIZ];    /* recip address for incoming faxes */
  106.     char    subject[BUFSIZ];    /* standard string for subject */
  107.                     /* strings on submitted messages */
  108.     int    (*receiveG3Fax)();    /* wait and get incoming fax */
  109. } FaxCtlr;
  110.  
  111. #define NULLFAXCTRLR    ((FaxCtlr *)0)
  112.  
  113. extern    FaxCtlr    *int_faxctrlr();
  114.  
  115. #define BITSPERBYTE    8
  116.  
  117.  
  118. #define FAX_OUTBOUND    0
  119. #define    FAX_INBOUND    1
  120. #define FAX_BOTH    2
  121. #endif
  122.